#include <exception>
#include <string>

class ContactsException : public std::exception
{
public:
    ContactsException(const std::string& msg = "An unknown error occurred")
        : message(msg) {}

    virtual const char* what() const noexcept override {
        return message.c_str();
    }

private:
    std::string message;
};